

package com.example.act6.common.entities;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * Layui分页
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0 2018-03-12
 */
@Setter
@Getter
@ToString
public class LayuiPage<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private int pageSize;
    private int currentPage;
    private int code = 0;
    //总记录数
    private long count;
    //列表数据
    private List<T> data;

    public LayuiPage() {
    }

    public LayuiPage(List<T> data, long count) {
        this.data = data;
        this.count = count;
    }

    public LayuiPage(List<T> data, long count, int currentPage) {
        this.data = data;
        this.count = count;
        this.currentPage = currentPage;
    }

    public LayuiPage(List<T> data, long count, int currentPage, int pageSize) {
        this.data = data;
        this.count = count;
        this.currentPage = currentPage;
        this.pageSize = pageSize;
    }

    public LayuiPage(List<T> data, long count, int currentPage, long pageSize) {
        this.data = data;
        this.count = count;
        this.currentPage = currentPage;
        this.pageSize = (int) pageSize;
    }
}
